import _ from "lodash";
import axios from "axios";
import "./style.css";

import toml from "./data.toml";
import yaml from "./data.yaml";
import json from "./data.json5";
import printMe from "./print.js";

debugger;

console.log("toml", toml); // output `TOML Example`

console.log("yaml", yaml); // output `YAML Example`

console.log("json", json); // output `JSON5 Example`

function component() {
  const element = document.createElement("div");
  const btn = document.createElement("button");

  element.innerHTML = _.join(["Hello", "webpack"], " ");
  element.classList.add("hello");

  btn.innerHTML = "Click me and check the console!";
  btn.onclick = printMe;

  element.appendChild(btn);
  axios.get("/baidu").then((data) => {
    console.log(data);
  });

  return element;
}

document.body.appendChild(component());
